   1              		.syntax unified
   2              		.cpu cortex-m3
   3              		.fpu softvfp
   4              		.eabi_attribute 20, 1
   5              		.eabi_attribute 21, 1
   6              		.eabi_attribute 23, 3
   7              		.eabi_attribute 24, 1
   8              		.eabi_attribute 25, 1
   9              		.eabi_attribute 26, 1
  10              		.eabi_attribute 30, 4
  11              		.eabi_attribute 34, 1
  12              		.eabi_attribute 18, 4
  13              		.thumb
  14              		.syntax unified
  15              		.file	"servos.c"
  16              		.text
  17              	.Ltext0:
  18              		.cfi_sections	.debug_frame
  19              		.section	.text.servo_Init,"ax",%progbits
  20              		.align	1
  21              		.global	servo_Init
  22              		.thumb
  23              		.thumb_func
  25              	servo_Init:
  26              	.LFB0:
  27              		.file 1 "servos.c"
   1:servos.c      **** #include "app.h"
   2:servos.c      **** 
   3:servos.c      **** volatile uint servosTick = 0;
   4:servos.c      **** void servo_Init(void) {
  28              		.loc 1 4 0
  29              		.cfi_startproc
  30              		@ args = 0, pretend = 0, frame = 0
  31              		@ frame_needed = 0, uses_anonymous_args = 0
  32 0000 F8B5     		push	{r3, r4, r5, r6, r7, lr}
  33              	.LCFI0:
  34              		.cfi_def_cfa_offset 24
  35              		.cfi_offset 3, -24
  36              		.cfi_offset 4, -20
  37              		.cfi_offset 5, -16
  38              		.cfi_offset 6, -12
  39              		.cfi_offset 7, -8
  40              		.cfi_offset 14, -4
   5:servos.c      **** 	servus_Init();
  41              		.loc 1 5 0
  42 0002 FFF7FEFF 		bl	servus_Init
  43              	.LVL0:
  44 0006 114A     		ldr	r2, .L5
   6:servos.c      **** 	uint x;	for (x=0;x<SERVO_N_MODULE;x++) {
  45              		.loc 1 6 0
  46 0008 0023     		movs	r3, #0
  47 000a 1446     		mov	r4, r2
   7:servos.c      **** 		control.servo[x].countProgress = 0;
  48              		.loc 1 7 0
  49 000c 1946     		mov	r1, r3
   8:servos.c      **** 		control.servo[x].timeActiveCount = 0;
   9:servos.c      **** 		control.servo[x].pos = 1500;// TODO: ler valores eeprom
  50              		.loc 1 9 0
  51 000e 40F2DC57 		movw	r7, #1500
  10:servos.c      **** 		control.servo[x].posNew = control.servo[x].pos;
  11:servos.c      **** 		control.servo[x].min = 100; // TODO: ler valores eeprom
  12:servos.c      **** 		control.servo[x].max = 3000; // TODO: ler valores eeprom
  52              		.loc 1 12 0
  53 0012 40F6B83E 		movw	lr, #3000
   7:servos.c      **** 		control.servo[x].timeActiveCount = 0;
  54              		.loc 1 7 0
  55 0016 2825     		movs	r5, #40
  11:servos.c      **** 		control.servo[x].max = 3000; // TODO: ler valores eeprom
  56              		.loc 1 11 0
  57 0018 4FF0640C 		mov	ip, #100
  58              	.LVL1:
  59              	.L2:
   7:servos.c      **** 		control.servo[x].timeActiveCount = 0;
  60              		.loc 1 7 0 discriminator 3
  61 001c 05FB0340 		mla	r0, r5, r3, r4
  62 0020 4162     		str	r1, [r0, #36]
   8:servos.c      **** 		control.servo[x].pos = 1500;// TODO: ler valores eeprom
  63              		.loc 1 8 0 discriminator 3
  64 0022 C161     		str	r1, [r0, #28]
   9:servos.c      **** 		control.servo[x].posNew = control.servo[x].pos;
  65              		.loc 1 9 0 discriminator 3
  66 0024 D762     		str	r7, [r2, #44]
  10:servos.c      **** 		control.servo[x].min = 100; // TODO: ler valores eeprom
  67              		.loc 1 10 0 discriminator 3
  68 0026 1763     		str	r7, [r2, #48]
  11:servos.c      **** 		control.servo[x].max = 3000; // TODO: ler valores eeprom
  69              		.loc 1 11 0 discriminator 3
  70 0028 C2F838C0 		str	ip, [r2, #56]
  71              		.loc 1 12 0 discriminator 3
  72 002c C2F83CE0 		str	lr, [r2, #60]
  13:servos.c      **** 		control.servo[x].enabled = 0; // TODO: ler valores eeprom
  73              		.loc 1 13 0 discriminator 3
  74 0030 067E     		ldrb	r6, [r0, #24]	@ zero_extendqisi2
  14:servos.c      **** 		control.servo[x].offset = 0; // TODO: ler valores eeprom
  15:servos.c      **** 		control.servo[x].time = 0;
  75              		.loc 1 15 0 discriminator 3
  76 0032 0133     		adds	r3, r3, #1
  77              	.LVL2:
  13:servos.c      **** 		control.servo[x].enabled = 0; // TODO: ler valores eeprom
  78              		.loc 1 13 0 discriminator 3
  79 0034 6FF30006 		bfc	r6, #0, #1
  80 0038 0676     		strb	r6, [r0, #24]
  81              		.loc 1 15 0 discriminator 3
  82 003a 05FB03F0 		mul	r0, r5, r3
   6:servos.c      **** 		control.servo[x].countProgress = 0;
  83              		.loc 1 6 0 discriminator 3
  84 003e 062B     		cmp	r3, #6
  14:servos.c      **** 		control.servo[x].offset = 0; // TODO: ler valores eeprom
  85              		.loc 1 14 0 discriminator 3
  86 0040 5163     		str	r1, [r2, #52]
  87              		.loc 1 15 0 discriminator 3
  88 0042 2150     		str	r1, [r4, r0]
  89              	.LVL3:
  90 0044 02F12802 		add	r2, r2, #40
   6:servos.c      **** 		control.servo[x].countProgress = 0;
  91              		.loc 1 6 0 discriminator 3
  92 0048 E8D1     		bne	.L2
  16:servos.c      **** 	}
  17:servos.c      **** }
  93              		.loc 1 17 0
  94 004a F8BD     		pop	{r3, r4, r5, r6, r7, pc}
  95              	.LVL4:
  96              	.L6:
  97              		.align	2
  98              	.L5:
  99 004c 00000000 		.word	control
 100              		.cfi_endproc
 101              	.LFE0:
 103              		.section	.text.servo_Config,"ax",%progbits
 104              		.align	1
 105              		.global	servo_Config
 106              		.thumb
 107              		.thumb_func
 109              	servo_Config:
 110              	.LFB1:
  18:servos.c      **** 
  19:servos.c      **** // podemos acionar o servo de modo que a posição ou movimento se faz de modo direto ou progressivo 
  20:servos.c      **** int servo_Config(uint servo, uint min, uint max, int offset) {
 111              		.loc 1 20 0
 112              		.cfi_startproc
 113              		@ args = 0, pretend = 0, frame = 0
 114              		@ frame_needed = 0, uses_anonymous_args = 0
 115              	.LVL5:
 116 0000 30B5     		push	{r4, r5, lr}
 117              	.LCFI1:
 118              		.cfi_def_cfa_offset 12
 119              		.cfi_offset 4, -12
 120              		.cfi_offset 5, -8
 121              		.cfi_offset 14, -4
  21:servos.c      **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 122              		.loc 1 21 0
 123 0002 441E     		subs	r4, r0, #1
 124 0004 052C     		cmp	r4, #5
 125 0006 14D8     		bhi	.L9
  22:servos.c      **** 	if ( (min<100) || (min>3000) ) return errDEVICE_VALUE_INVALID;
 126              		.loc 1 22 0
 127 0008 40F65430 		movw	r0, #2900
 128              	.LVL6:
 129 000c A1F16405 		sub	r5, r1, #100
 130 0010 8542     		cmp	r5, r0
 131 0012 10D8     		bhi	.L12
  23:servos.c      **** 	if ( (max<=min) || (max>3000) ) return errDEVICE_VALUE_INVALID;
 132              		.loc 1 23 0
 133 0014 9142     		cmp	r1, r2
 134 0016 0ED2     		bcs	.L12
 135              		.loc 1 23 0 is_stmt 0 discriminator 2
 136 0018 40F6B830 		movw	r0, #3000
 137 001c 8242     		cmp	r2, r0
 138 001e 0AD8     		bhi	.L12
  24:servos.c      **** 
  25:servos.c      **** 	control.servo[servo-1].min = min;
 139              		.loc 1 25 0 is_stmt 1
 140 0020 0648     		ldr	r0, .L13
 141 0022 2825     		movs	r5, #40
 142 0024 05FB0400 		mla	r0, r5, r4, r0
 143 0028 8163     		str	r1, [r0, #56]
  26:servos.c      **** 	control.servo[servo-1].max = max;
 144              		.loc 1 26 0
 145 002a C263     		str	r2, [r0, #60]
  27:servos.c      **** 	control.servo[servo-1].offset = offset;
 146              		.loc 1 27 0
 147 002c 4363     		str	r3, [r0, #52]
  28:servos.c      **** 
  29:servos.c      **** 	// TODO: salvar eeprom
  30:servos.c      **** 	return pdPASS;
 148              		.loc 1 30 0
 149 002e 0120     		movs	r0, #1
 150 0030 30BD     		pop	{r4, r5, pc}
 151              	.LVL7:
 152              	.L9:
  21:servos.c      **** 	if ( (min<100) || (min>3000) ) return errDEVICE_VALUE_INVALID;
 153              		.loc 1 21 0
 154 0032 0348     		ldr	r0, .L13+4
 155              	.LVL8:
 156 0034 30BD     		pop	{r4, r5, pc}
 157              	.LVL9:
 158              	.L12:
  22:servos.c      **** 	if ( (max<=min) || (max>3000) ) return errDEVICE_VALUE_INVALID;
 159              		.loc 1 22 0
 160 0036 6FF49770 		mvn	r0, #302
  31:servos.c      **** }
 161              		.loc 1 31 0
 162 003a 30BD     		pop	{r4, r5, pc}
 163              	.L14:
 164              		.align	2
 165              	.L13:
 166 003c 00000000 		.word	control
 167 0040 D4FEFFFF 		.word	-300
 168              		.cfi_endproc
 169              	.LFE1:
 171              		.section	.text.servo_Enable,"ax",%progbits
 172              		.align	1
 173              		.global	servo_Enable
 174              		.thumb
 175              		.thumb_func
 177              	servo_Enable:
 178              	.LFB2:
  32:servos.c      **** // Habilita ou não um determinado servo.
  33:servos.c      **** // Se habilitar a saída PWM do servo será gerado, senão fica em nível baixo.
  34:servos.c      **** //	sinalizando ao servo para se manter desligado
  35:servos.c      **** int servo_Enable(uint servo, uint en) {
 179              		.loc 1 35 0
 180              		.cfi_startproc
 181              		@ args = 0, pretend = 0, frame = 0
 182              		@ frame_needed = 0, uses_anonymous_args = 0
 183              	.LVL10:
  36:servos.c      **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 184              		.loc 1 36 0
 185 0000 421E     		subs	r2, r0, #1
 186 0002 052A     		cmp	r2, #5
  35:servos.c      **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 187              		.loc 1 35 0
 188 0004 10B5     		push	{r4, lr}
 189              	.LCFI2:
 190              		.cfi_def_cfa_offset 8
 191              		.cfi_offset 4, -8
 192              		.cfi_offset 14, -4
 193              		.loc 1 36 0
 194 0006 0FD8     		bhi	.L18
  37:servos.c      **** 	control.servo[servo-1].enabled = en;
 195              		.loc 1 37 0
 196 0008 084B     		ldr	r3, .L19
 197 000a 2824     		movs	r4, #40
 198 000c 04FB0233 		mla	r3, r4, r2, r3
 199 0010 1A7E     		ldrb	r2, [r3, #24]	@ zero_extendqisi2
 200 0012 01F00101 		and	r1, r1, #1
 201              	.LVL11:
 202 0016 61F30002 		bfi	r2, r1, #0, #1
 203 001a 1A76     		strb	r2, [r3, #24]
  38:servos.c      **** 
  39:servos.c      **** 	if (control.servo[servo-1].enabled)
 204              		.loc 1 39 0
 205 001c 01B1     		cbz	r1, .L17
  40:servos.c      **** 			servus_Enable(servo, 1); // liga o servo
 206              		.loc 1 40 0
 207 001e 0121     		movs	r1, #1
 208              	.L17:
  41:servos.c      **** 	else	servus_Enable(servo, 0); // desliga o servo
 209              		.loc 1 41 0
 210 0020 FFF7FEFF 		bl	servus_Enable
 211              	.LVL12:
  42:servos.c      **** 
  43:servos.c      **** 	return pdPASS;
 212              		.loc 1 43 0
 213 0024 0120     		movs	r0, #1
 214 0026 10BD     		pop	{r4, pc}
 215              	.LVL13:
 216              	.L18:
  36:servos.c      **** 	control.servo[servo-1].enabled = en;
 217              		.loc 1 36 0
 218 0028 0148     		ldr	r0, .L19+4
 219              	.LVL14:
  44:servos.c      **** }
 220              		.loc 1 44 0
 221 002a 10BD     		pop	{r4, pc}
 222              	.L20:
 223              		.align	2
 224              	.L19:
 225 002c 00000000 		.word	control
 226 0030 D4FEFFFF 		.word	-300
 227              		.cfi_endproc
 228              	.LFE2:
 230              		.section	.text.servo_SetPos,"ax",%progbits
 231              		.align	1
 232              		.global	servo_SetPos
 233              		.thumb
 234              		.thumb_func
 236              	servo_SetPos:
 237              	.LFB3:
  45:servos.c      **** 
  46:servos.c      **** 
  47:servos.c      **** // Ajusta o posicionamento do servo desejado
  48:servos.c      **** //	servo: o servo alvo para posicionamento, valor de 1 a 6
  49:servos.c      **** //  us: largura do pulso em microsegundos de controle de posição do servos. Valor entre 100 a 3000u
  50:servos.c      **** // tp (ms). Valor 0: não há modo progressivo para o servo. Valor > 0 faz modo progressivo
  51:servos.c      **** // timeActiveOff: tempo em segundos que o servo vai ficar ativo. Valor 0 sinaliza ficar ligado dire
  52:servos.c      **** int servo_SetPos(uint servo, uint us, uint tp, uint timeActiveOff) {
 238              		.loc 1 52 0
 239              		.cfi_startproc
 240              		@ args = 0, pretend = 0, frame = 0
 241              		@ frame_needed = 0, uses_anonymous_args = 0
 242              	.LVL15:
 243 0000 2DE9F047 		push	{r4, r5, r6, r7, r8, r9, r10, lr}
 244              	.LCFI3:
 245              		.cfi_def_cfa_offset 32
 246              		.cfi_offset 4, -32
 247              		.cfi_offset 5, -28
 248              		.cfi_offset 6, -24
 249              		.cfi_offset 7, -20
 250              		.cfi_offset 8, -16
 251              		.cfi_offset 9, -12
 252              		.cfi_offset 10, -8
 253              		.cfi_offset 14, -4
 254              		.loc 1 52 0
 255 0004 0D46     		mov	r5, r1
  53:servos.c      **** 	if ( (servo==0) || (servo>SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 256              		.loc 1 53 0
 257 0006 411E     		subs	r1, r0, #1
 258              	.LVL16:
 259 0008 0529     		cmp	r1, #5
  52:servos.c      **** 	if ( (servo==0) || (servo>SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 260              		.loc 1 52 0
 261 000a 8046     		mov	r8, r0
 262 000c 9146     		mov	r9, r2
 263              		.loc 1 53 0
 264 000e 43D8     		bhi	.L25
  54:servos.c      **** 	if ( (us<control.servo[servo-1].min) || (us > control.servo[servo-1].max) ) return errDEVICE_VALUE
 265              		.loc 1 54 0
 266 0010 264C     		ldr	r4, .L30
 267 0012 2826     		movs	r6, #40
 268 0014 06FB0141 		mla	r1, r6, r1, r4
 269 0018 8A6B     		ldr	r2, [r1, #56]
 270              	.LVL17:
 271 001a AA42     		cmp	r2, r5
 272 001c 3FD8     		bhi	.L27
 273              		.loc 1 54 0 is_stmt 0 discriminator 2
 274 001e CA6B     		ldr	r2, [r1, #60]
 275 0020 9542     		cmp	r5, r2
 276 0022 3CD8     		bhi	.L27
  55:servos.c      **** 	if ( (us<100) || (us>3000)) return errDEVICE_VALUE_INVALID;
 277              		.loc 1 55 0 is_stmt 1
 278 0024 40F65432 		movw	r2, #2900
 279 0028 A5F16407 		sub	r7, r5, #100
 280 002c 9742     		cmp	r7, r2
 281 002e 39D8     		bhi	.L28
  56:servos.c      **** 
  57:servos.c      **** 	// o servo 3 será o espelho do servo 2
  58:servos.c      **** 	if (servo == 3) return pdPASS;
 282              		.loc 1 58 0
 283 0030 0328     		cmp	r0, #3
 284 0032 2ED0     		beq	.L29
  59:servos.c      **** 
  60:servos.c      **** 	control.servo[servo-1].posNew = us;
  61:servos.c      **** 	control.servo[servo-1].countProgress = tp;
  62:servos.c      **** 	control.servo[servo-1].time = servosTick;
  63:servos.c      **** 	control.servo[servo-1].timeActiveCount = 0;
  64:servos.c      **** 	control.servo[servo-1].timeActiveOff = timeActiveOff*1000; // Multiplicar por 1000 porque o tempo 
 285              		.loc 1 64 0
 286 0034 4FF47A77 		mov	r7, #1000
  62:servos.c      **** 	control.servo[servo-1].timeActiveCount = 0;
 287              		.loc 1 62 0
 288 0038 4643     		muls	r6, r0, r6
 289              		.loc 1 64 0
 290 003a 5F43     		muls	r7, r3, r7
  62:servos.c      **** 	control.servo[servo-1].timeActiveCount = 0;
 291              		.loc 1 62 0
 292 003c 1C4A     		ldr	r2, .L30+4
  61:servos.c      **** 	control.servo[servo-1].time = servosTick;
 293              		.loc 1 61 0
 294 003e C1F82490 		str	r9, [r1, #36]
  65:servos.c      **** 	//control.servo[servo-1].pos = 0; 	// para forçar a ir para posição nova, caso a última poisção re
  66:servos.c      **** 											// pode acontecer que o servo seja reposicionado manualmemente quanto saida pwm desligad
  67:servos.c      **** 	control.servo[servo-1].enabled = 1;
 295              		.loc 1 67 0
 296 0042 0B7E     		ldrb	r3, [r1, #24]	@ zero_extendqisi2
 297              	.LVL18:
  62:servos.c      **** 	control.servo[servo-1].timeActiveCount = 0;
 298              		.loc 1 62 0
 299 0044 1268     		ldr	r2, [r2]
 300              		.loc 1 67 0
 301 0046 43F00103 		orr	r3, r3, #1
  63:servos.c      **** 	control.servo[servo-1].timeActiveOff = timeActiveOff*1000; // Multiplicar por 1000 porque o tempo 
 302              		.loc 1 63 0
 303 004a 4FF0000A 		mov	r10, #0
  62:servos.c      **** 	control.servo[servo-1].timeActiveCount = 0;
 304              		.loc 1 62 0
 305 004e A251     		str	r2, [r4, r6]
  60:servos.c      **** 	control.servo[servo-1].countProgress = tp;
 306              		.loc 1 60 0
 307 0050 0D63     		str	r5, [r1, #48]
  63:servos.c      **** 	control.servo[servo-1].timeActiveOff = timeActiveOff*1000; // Multiplicar por 1000 porque o tempo 
 308              		.loc 1 63 0
 309 0052 C1F81CA0 		str	r10, [r1, #28]
 310              		.loc 1 67 0
 311 0056 0B76     		strb	r3, [r1, #24]
  64:servos.c      **** 	//control.servo[servo-1].pos = 0; 	// para forçar a ir para posição nova, caso a última poisção re
 312              		.loc 1 64 0
 313 0058 0F62     		str	r7, [r1, #32]
  68:servos.c      **** 	servus_Enable(servo, 1); // Liga o servo
 314              		.loc 1 68 0
 315 005a 0121     		movs	r1, #1
 316 005c FFF7FEFF 		bl	servus_Enable
 317              	.LVL19:
  69:servos.c      **** 
  70:servos.c      **** 	// o servo 3 será o espelho do servo 2
  71:servos.c      **** 	if (servo == 2) {
 318              		.loc 1 71 0
 319 0060 B8F1020F 		cmp	r8, #2
 320 0064 15D1     		bne	.L29
  72:servos.c      **** 		control.servo[servo].posNew = (1500-(us-1500));
  73:servos.c      **** 		control.servo[servo].countProgress = tp;
 321              		.loc 1 73 0
 322 0066 C4F87490 		str	r9, [r4, #116]
  74:servos.c      **** 		control.servo[servo].time = control.servo[servo-1].time;
 323              		.loc 1 74 0
 324 006a A359     		ldr	r3, [r4, r6]
  72:servos.c      **** 		control.servo[servo].posNew = (1500-(us-1500));
 325              		.loc 1 72 0
 326 006c C5F53B65 		rsb	r5, r5, #2992
 327              	.LVL20:
 328              		.loc 1 74 0
 329 0070 A367     		str	r3, [r4, #120]
  75:servos.c      **** 		control.servo[servo].timeActiveCount = 0;
  76:servos.c      **** 		control.servo[servo].timeActiveOff = timeActiveOff*1000; // Multiplicar por 1000 porque o tempo d
  77:servos.c      **** 		//control.servo[servo].pos = 0; 	// para forçar a ir para posição nova, caso a última poisção reg
  78:servos.c      **** 											// pode acontecer que o servo seja reposicionado manualmemente quanto saida pwm desligad
  79:servos.c      **** 		control.servo[servo].enabled = 1;
 330              		.loc 1 79 0
 331 0072 94F86830 		ldrb	r3, [r4, #104]	@ zero_extendqisi2
  72:servos.c      **** 		control.servo[servo].countProgress = tp;
 332              		.loc 1 72 0
 333 0076 0835     		adds	r5, r5, #8
 334              		.loc 1 79 0
 335 0078 43F00103 		orr	r3, r3, #1
  75:servos.c      **** 		control.servo[servo].timeActiveCount = 0;
 336              		.loc 1 75 0
 337 007c C4F86CA0 		str	r10, [r4, #108]
  72:servos.c      **** 		control.servo[servo].countProgress = tp;
 338              		.loc 1 72 0
 339 0080 C4F88050 		str	r5, [r4, #128]
  76:servos.c      **** 		//control.servo[servo].pos = 0; 	// para forçar a ir para posição nova, caso a última poisção reg
 340              		.loc 1 76 0
 341 0084 2767     		str	r7, [r4, #112]
 342              		.loc 1 79 0
 343 0086 84F86830 		strb	r3, [r4, #104]
  80:servos.c      **** 		servus_Enable(servo+1, 1); // Liga o servo
 344              		.loc 1 80 0
 345 008a 0121     		movs	r1, #1
 346 008c 0320     		movs	r0, #3
 347 008e FFF7FEFF 		bl	servus_Enable
 348              	.LVL21:
 349              	.L29:
  81:servos.c      **** 	};
  82:servos.c      **** 
  83:servos.c      **** 	return pdPASS;
 350              		.loc 1 83 0
 351 0092 0120     		movs	r0, #1
 352 0094 BDE8F087 		pop	{r4, r5, r6, r7, r8, r9, r10, pc}
 353              	.LVL22:
 354              	.L25:
  53:servos.c      **** 	if ( (us<control.servo[servo-1].min) || (us > control.servo[servo-1].max) ) return errDEVICE_VALUE
 355              		.loc 1 53 0
 356 0098 0648     		ldr	r0, .L30+8
 357              	.LVL23:
 358 009a BDE8F087 		pop	{r4, r5, r6, r7, r8, r9, r10, pc}
 359              	.LVL24:
 360              	.L27:
  54:servos.c      **** 	if ( (us<100) || (us>3000)) return errDEVICE_VALUE_INVALID;
 361              		.loc 1 54 0
 362 009e 0648     		ldr	r0, .L30+12
 363              	.LVL25:
 364 00a0 BDE8F087 		pop	{r4, r5, r6, r7, r8, r9, r10, pc}
 365              	.LVL26:
 366              	.L28:
  55:servos.c      **** 
 367              		.loc 1 55 0
 368 00a4 6FF49770 		mvn	r0, #302
 369              	.LVL27:
  84:servos.c      **** }
 370              		.loc 1 84 0
 371 00a8 BDE8F087 		pop	{r4, r5, r6, r7, r8, r9, r10, pc}
 372              	.LVL28:
 373              	.L31:
 374              		.align	2
 375              	.L30:
 376 00ac 00000000 		.word	control
 377 00b0 00000000 		.word	.LANCHOR0
 378 00b4 D4FEFFFF 		.word	-300
 379 00b8 D0FEFFFF 		.word	-304
 380              		.cfi_endproc
 381              	.LFE3:
 383              		.section	.text.servo_Tick,"ax",%progbits
 384              		.align	1
 385              		.global	servo_Tick
 386              		.thumb
 387              		.thumb_func
 389              	servo_Tick:
 390              	.LFB4:
  85:servos.c      **** 
  86:servos.c      **** void servo_Tick(void) {
 391              		.loc 1 86 0
 392              		.cfi_startproc
 393              		@ args = 0, pretend = 0, frame = 0
 394              		@ frame_needed = 0, uses_anonymous_args = 0
 395 0000 2DE9F84F 		push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
 396              	.LCFI4:
 397              		.cfi_def_cfa_offset 40
 398              		.cfi_offset 3, -40
 399              		.cfi_offset 4, -36
 400              		.cfi_offset 5, -32
 401              		.cfi_offset 6, -28
 402              		.cfi_offset 7, -24
 403              		.cfi_offset 8, -20
 404              		.cfi_offset 9, -16
 405              		.cfi_offset 10, -12
 406              		.cfi_offset 11, -8
 407              		.cfi_offset 14, -4
  87:servos.c      **** //	uint x;	for (x=0;x<SERVO_N_MODULE;x++) { // fazer para todos os servos
  88:servos.c      **** //		if (control.servo[x].pos != control.servo[x].posNew) { // se a posição for diferente vamos atua
  89:servos.c      **** //			control.servo[x].pos = control.servo[x].posNew;
  90:servos.c      **** //			servus_SetPos(x+1, control.servo[x].pos); // atualizar a posição do servo
  91:servos.c      **** //			control.servo[x].timeActiveCount = 0; // sinaliza que o servo está se posicionando
  92:servos.c      **** //		} else control.servo[x].timeActiveCount++;
  93:servos.c      **** //
  94:servos.c      **** //		// Desliga o servo caso foi especificado o tempo para manter ligado
  95:servos.c      **** //		if ( (control.servo[x].timeActiveOff > 0) && (control.servo[x].timeActiveCount > control.servo[
  96:servos.c      **** // 			servus_Enable(x+1, 0); // desliga o servo
  97:servos.c      **** //	}
  98:servos.c      **** 	servosTick++;
 408              		.loc 1 98 0
 409 0004 244F     		ldr	r7, .L46
 410 0006 254D     		ldr	r5, .L46+4
  99:servos.c      **** 
 100:servos.c      **** 	// fazer para todos os servos
 101:servos.c      **** 	uint x;	for (x=0;x<SERVO_N_MODULE;x++) {
 102:servos.c      **** 		// se a posição for diferente vamos atualizar o servo
 103:servos.c      **** 		if (control.servo[x].pos != control.servo[x].posNew) {
 104:servos.c      **** 			if (control.servo[x].countProgress) { // se for de modo progressivo vamos mudar em 10 us a posis
 105:servos.c      **** 				// se não estourou o tempo de progressão do servo, não faz nada
 106:servos.c      **** 				if (control.servo[x].time + control.servo[x].countProgress > servosTick) continue;
 411              		.loc 1 106 0
 412 0008 B946     		mov	r9, r7
 413 000a AB46     		mov	fp, r5
 104:servos.c      **** 				// se não estourou o tempo de progressão do servo, não faz nada
 414              		.loc 1 104 0
 415 000c A846     		mov	r8, r5
  98:servos.c      **** 
 416              		.loc 1 98 0
 417 000e 3B68     		ldr	r3, [r7]
 418 0010 0126     		movs	r6, #1
 419 0012 0133     		adds	r3, r3, #1
 420 0014 3B60     		str	r3, [r7]
 421              	.LVL29:
 422 0016 4FF0280A 		mov	r10, #40
 423              	.LVL30:
 424              	.L40:
 103:servos.c      **** 			if (control.servo[x].countProgress) { // se for de modo progressivo vamos mudar em 10 us a posis
 425              		.loc 1 103 0
 426 001a EB6A     		ldr	r3, [r5, #44]
 427 001c 2A6B     		ldr	r2, [r5, #48]
 428 001e 741E     		subs	r4, r6, #1
 429              	.LVL31:
 430 0020 9342     		cmp	r3, r2
 431 0022 21D0     		beq	.L33
 104:servos.c      **** 				// se não estourou o tempo de progressão do servo, não faz nada
 432              		.loc 1 104 0
 433 0024 0AFB04B1 		mla	r1, r10, r4, fp
 434 0028 486A     		ldr	r0, [r1, #36]
 435 002a 98B1     		cbz	r0, .L34
 436              		.loc 1 106 0
 437 002c 0AFB06F0 		mul	r0, r10, r6
 438 0030 58F800C0 		ldr	ip, [r8, r0]
 439 0034 496A     		ldr	r1, [r1, #36]
 440 0036 D7F800E0 		ldr	lr, [r7]
 441 003a 6144     		add	r1, r1, ip
 442 003c 7145     		cmp	r1, lr
 443 003e 23D8     		bhi	.L36
 107:servos.c      **** 				control.servo[x].time = servosTick; // atauliza o tempo
 108:servos.c      **** 				// nova posição do servo de acordo com a posição atual
 109:servos.c      **** 				if (control.servo[x].pos < control.servo[x].posNew) control.servo[x].pos += 10; else control.se
 444              		.loc 1 109 0
 445 0040 9342     		cmp	r3, r2
 107:servos.c      **** 				control.servo[x].time = servosTick; // atauliza o tempo
 446              		.loc 1 107 0
 447 0042 D9F80010 		ldr	r1, [r9]
 448              		.loc 1 109 0
 449 0046 34BF     		ite	cc
 450 0048 0A33     		addcc	r3, r3, #10
 451 004a 0A3B     		subcs	r3, r3, #10
 107:servos.c      **** 				control.servo[x].time = servosTick; // atauliza o tempo
 452              		.loc 1 107 0
 453 004c 48F80010 		str	r1, [r8, r0]
 454              		.loc 1 109 0
 455 0050 EB62     		str	r3, [r5, #44]
 456 0052 00E0     		b	.L38
 457              	.L34:
 110:servos.c      **** 			} else control.servo[x].pos = control.servo[x].posNew; // se não for modo progressivo, troca ime
 458              		.loc 1 110 0
 459 0054 EA62     		str	r2, [r5, #44]
 460              	.L38:
 111:servos.c      **** 
 112:servos.c      **** 			servus_SetPos(x+1, control.servo[x].pos); 	// Atualizar a posição do servo
 461              		.loc 1 112 0
 462 0056 E96A     		ldr	r1, [r5, #44]
 463 0058 3046     		mov	r0, r6
 464 005a FFF7FEFF 		bl	servus_SetPos
 465              	.LVL32:
 113:servos.c      **** 			control.servo[x].timeActiveCount = 0; 		// Sinaliza que o servo está ainde se posicionando, entã
 466              		.loc 1 113 0
 467 005e 0AFB04B3 		mla	r3, r10, r4, fp
 468 0062 0022     		movs	r2, #0
 469 0064 DA61     		str	r2, [r3, #28]
 470 0066 0FE0     		b	.L36
 471              	.L33:
 114:servos.c      **** 
 115:servos.c      **** 		// se está na posição correta, vamos determinar o tempo de acionamento do mesmo caso foi especifi
 116:servos.c      **** 		} else {
 117:servos.c      **** 			control.servo[x].countProgress = 0;
 472              		.loc 1 117 0
 473 0068 0AFB04B3 		mla	r3, r10, r4, fp
 474 006c 0021     		movs	r1, #0
 475 006e 5962     		str	r1, [r3, #36]
 118:servos.c      **** 			control.servo[x].timeActiveCount++;
 476              		.loc 1 118 0
 477 0070 DA69     		ldr	r2, [r3, #28]
 478 0072 0132     		adds	r2, r2, #1
 479 0074 DA61     		str	r2, [r3, #28]
 119:servos.c      **** 
 120:servos.c      **** 			// Desliga o servo caso foi especificado o tempo para manter ligado
 121:servos.c      **** 			if ( (control.servo[x].timeActiveOff > 0) && (control.servo[x].timeActiveCount > control.servo[x
 480              		.loc 1 121 0
 481 0076 1A6A     		ldr	r2, [r3, #32]
 482 0078 32B1     		cbz	r2, .L36
 483              		.loc 1 121 0 is_stmt 0 discriminator 1
 484 007a DA69     		ldr	r2, [r3, #28]
 485 007c 1B6A     		ldr	r3, [r3, #32]
 486 007e 9A42     		cmp	r2, r3
 487 0080 02D9     		bls	.L36
 122:servos.c      **** 	 			servus_Enable(x+1, 0); // desliga o servo
 488              		.loc 1 122 0 is_stmt 1
 489 0082 3046     		mov	r0, r6
 490 0084 FFF7FEFF 		bl	servus_Enable
 491              	.LVL33:
 492              	.L36:
 493 0088 0136     		adds	r6, r6, #1
 494              	.LVL34:
 101:servos.c      **** 		// se a posição for diferente vamos atualizar o servo
 495              		.loc 1 101 0 discriminator 2
 496 008a 072E     		cmp	r6, #7
 497 008c 05F12805 		add	r5, r5, #40
 498 0090 C3D1     		bne	.L40
 123:servos.c      **** 		}
 124:servos.c      **** 	}
 125:servos.c      **** }
 499              		.loc 1 125 0
 500 0092 BDE8F88F 		pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
 501              	.LVL35:
 502              	.L47:
 503 0096 00BF     		.align	2
 504              	.L46:
 505 0098 00000000 		.word	.LANCHOR0
 506 009c 00000000 		.word	control
 507              		.cfi_endproc
 508              	.LFE4:
 510              		.global	servosTick
 511              		.comm	control,264,4
 512              		.section	.bss.servosTick,"aw",%nobits
 513              		.align	2
 514              		.set	.LANCHOR0,. + 0
 517              	servosTick:
 518 0000 00000000 		.space	4
 519              		.text
 520              	.Letext0:
 521              		.file 2 "app.h"
 522              		.file 3 "uc_libc_dev/_libdef/uc_libdefs.h"
 523              		.file 4 "uc_libc_dev/motors/servus.h"
DEFINED SYMBOLS
                            *ABS*:00000000 servos.c
D:\_temp\_windows\ccTt9G9s.s:20     .text.servo_Init:00000000 $t
D:\_temp\_windows\ccTt9G9s.s:25     .text.servo_Init:00000000 servo_Init
D:\_temp\_windows\ccTt9G9s.s:99     .text.servo_Init:0000004c $d
                            *COM*:00000108 control
D:\_temp\_windows\ccTt9G9s.s:104    .text.servo_Config:00000000 $t
D:\_temp\_windows\ccTt9G9s.s:109    .text.servo_Config:00000000 servo_Config
D:\_temp\_windows\ccTt9G9s.s:166    .text.servo_Config:0000003c $d
D:\_temp\_windows\ccTt9G9s.s:172    .text.servo_Enable:00000000 $t
D:\_temp\_windows\ccTt9G9s.s:177    .text.servo_Enable:00000000 servo_Enable
D:\_temp\_windows\ccTt9G9s.s:225    .text.servo_Enable:0000002c $d
D:\_temp\_windows\ccTt9G9s.s:231    .text.servo_SetPos:00000000 $t
D:\_temp\_windows\ccTt9G9s.s:236    .text.servo_SetPos:00000000 servo_SetPos
D:\_temp\_windows\ccTt9G9s.s:376    .text.servo_SetPos:000000ac $d
D:\_temp\_windows\ccTt9G9s.s:384    .text.servo_Tick:00000000 $t
D:\_temp\_windows\ccTt9G9s.s:389    .text.servo_Tick:00000000 servo_Tick
D:\_temp\_windows\ccTt9G9s.s:505    .text.servo_Tick:00000098 $d
D:\_temp\_windows\ccTt9G9s.s:517    .bss.servosTick:00000000 servosTick
D:\_temp\_windows\ccTt9G9s.s:513    .bss.servosTick:00000000 $d
                     .debug_frame:00000010 $d

UNDEFINED SYMBOLS
servus_Init
servus_Enable
servus_SetPos
